<?php session_start();
if($_SESSION['id_tipo_usuario']==1 AND $_SESSION['id_usuario']){

require_once '../framework/fw.php';	

require '../view/b_materialView.php';		
require '../view/success_b_materialView.php';		
require '../model/Material.php';


$envio = $_POST['envio'];
$id_material = $_GET['id'];


if($envio){
	$id_material = $_POST['id_material'];
	$material = new Material;
	$material->del_material($id_material);
	$pagina = new success_b_materialView;
	}
else	
	{
	$pagina = new b_materialView;
	$pagina->id_material = $id_material;
	}
	
$pagina->Render();
}

else{	session_destroy();
	header("location: clinica.htm");
}
?>